<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2018/4/18
  Time: 19:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html><head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>网易理财</title>

    <script src="./jquery/jquery.min.js"></script>


    <link rel="stylesheet" href="./bootstrap/bootstrap/css/bootstrap.css">
    <script src="./bootstrap/bootstrap/js/bootstrap.js"></script>
  <%--&lt;%&ndash;  <link rel="icon" href="./favicon1.ico">&ndash;%&gt;--%>
     <style>
          body{padding:0;margin:0;}
          html{height:100%;}
          a:hover{text-decoration: none;}
          .aa{cursor:pointer;position:relative;top:15px;}
          .bb{cursor:pointer;position:relative;top:15px;}
          .ss{cursor:pointer;}
          .t1{z-index:100000;display:none;background-color:#000;opacity:0.09;width:48%;}
          .t2{z-index:100000;display:none;background-color:#000;opacity:0.09;width:50%;}
          .col-sm-4 span{color:#FCB850;}
          .col-sm-4 a{color:#000;}
          .active a{color:#fff  !important;}
          .row input{border:none;}
          .lt span{color:#fff;}
          .sure span{color:#fff;display:inline-block;width:180px;background:rgba(199,148,43,0.5);}
          .sure span:hover{cursor:pointer;}
          .head a{color:#000;}
          .head a:hover{text-decoration:none;}
          .form-control{display:inline-block !important;}
          #box{background-image:url("/photos/1.jpg");background-position:center center;background-repeat:no-repeat;background-size:cover;}
      </style>
  </head>
  <body id="box">


  <div style="position:absolute;top:55%;left:55%;margin-left:-350px;margin-top:-263px;">
      <div class="box-detail" style="width: 500px; background: rgb(255, 255, 255);">  <!--宽高、定位层-->
          <div style="box-shadow: 0px 0px 15px #999; "> <!--背景色、边框、倒角、阴影-->
              <div style="background: #5bc0de;width:500px;height:70px;position: relative;">

                  <img src="/photos/99.jpg" style="position: absolute;left:58%;top:79%;width: 81px;margin-left:-85.5px;margin-top:-51px;" alt="网易理财">
              </div>
              <div class="modal-body" style="background:#f5f5f5;padding:30px 15px;height: 300px;">



                  <form id="form2" style="margin-top: 10px;">

                      <label  style="text-indent:2em;padding:0px 17px;">用户名：</label>
                      <input type="text" class="form-control " style="width: 270px" name="registerName" value="" placeholder="请输入您的用户名" ><br><br>
                      <label  style="text-indent:3em;padding:0px 17px;">密码：</label>

                      <input type="password" class="form-control " style="width: 270px" name="registerPass" value="" placeholder="请输入密码" ><br><br>

                      <input  type="button" style="border:none;background:#FBAF37;color:#fff;width:270px;padding:10px 10px;border-radius: 5px; text-align: center;margin-left: 25.7%;"  value="登录" id="loginbtn" class="ss check2"/><br><br>



                      <a  type="button" style="border:none;display:inline-block;color:#FBAF37;width:32%;height:38.4px;padding:10px 10px;border-radius: 5px;  text-align: center;float: left;margin-left: 22%;font-size: 13px;" id="loginbtn2" class="ss check2" >企业登录</a><br><br>

                      <a href="/personreg.jsp" >
                          <div style="border:none;color:#FBAF37;width:32%;padding:10px 10px;border-radius: 5px; text-align: center;float: right;margin-top: -8.65%;margin-right: 13%;font-size: 13px;" class="ss check2">
                              没有账号?去注册
                          </div>
                      </a>

                      <br>



                      <%--

                       <button info="" style="border:none;background:#FBAF37;color:#fff;width:43%;padding:10px 20px;border-radius: 5px; margin-left: 6.3em;text-align: center;" class="ss check2" id="loginbtn">
                                登录
                            </button>

                      --%>

                  </form>
              </div>
          </div>
      </div>
  </div>

<script>


    $("#loginbtn").click(function(){

        $.ajax({
            url:"http://localhost:8076/login/queryRegister",
            type:"post",
            data:$("#form2").serialize(),
            dataType:"text",
            success:function(result){
                result =     eval("("+result+")")
                //console.log(result)
                 alert(result.message);

               if(result.userid){

                    location.href="/index.jsp?username="+result.username+"&userid="+result.userid
                }else{

                   location.href="/personlogin.jsp"
              }

            }

        });
    })

    $("#loginbtn2").click(function(){


                    location.href="/companylogin.jsp"


    })


</script>



</body></html>
